package com.core.exception;

import java.text.MessageFormat;


public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 4497408473721665508L;

    private final String statusCode;

    private final String businessMessage;

    public BusinessException(String statusCode, String businessMessage) {
        super(getMessage(statusCode, businessMessage));
        this.statusCode = statusCode;
        this.businessMessage = businessMessage;
    }

    private static String getMessage(String statusCode, String businessMessage) {
        return MessageFormat.format("StatusCode: {0}; BusinessMessage: {1}", statusCode, businessMessage);
    }

    public String getStatusCode() {
        return statusCode;
    }

    public String getBusinessMessage() {
        return businessMessage;
    }

}
